<template>
	<view class="article_category_left" @click.stop="gotoTopic">
		<image class="article_category_icon" src="/static/icon/topic.png"></image>
		<text class="articel_category_text">{{topicInfo.name}}</text>
	</view>
</template>

<script>
	export default {
		name: "topicNameBtn",
		props: {
			// 数据对象
			topicInfo: {
				type: Object,
				default () {
					return {
						id: null,
						name: '',
					}
				}
			},
		},
		data() {
			return {
				// calc((100% - 4px) / 3);
			}
		},
		methods: {
			// 前往详情
			gotoTopic(){
				if (this.topicInfo.id){
					uni.navigateTo({
						url: '/pages/topic/topicDetail?id='+this.topicInfo.id
					});
				}
			}

		}
	}
</script>

<style scoped lang="scss">

</style>
